package org.ccay.log;

import org.ccay.core.base.BaseResourceVO;
import org.ccay.core.util.StringUtil;


/**
 * SQL TRACLE 的值对象
 * 
 * @author chaowangbang
 */
public class SqlTraceVO extends BaseResourceVO {
	
	/**
	 * 自动生成的版本序列标识
	 */
	private static final long serialVersionUID = 4279409630537375534L;
	
	
	private Integer propertyId;
	
	/**
	 * 被跟踪的账号名称
	 */
	private String userAccount;
	/**
	 * 文件名
	 */
	private String traceFileIdentifier;
	/**
	 * 文件大小
	 */

	private String maxDumpFileSize;
	/**
	 * sqltrace级别,1,4,8,12
	 */
	private int sqlTraceLevel;
	/**
	 * 状态 
	 */
	private boolean sqlTraceStatus;

	public SqlTraceVO(){
		
	}
	/**
	 * @param userAccount
	 */
	public SqlTraceVO(String userAccount){
		this.userAccount = userAccount;
	}
	
	/**
	 * @return
	 */
	public String getUserAccount() {
		return userAccount;
	}

	/**
	 * @param userAccount
	 */
	public void setUserAccount(String userAccount) {
		this.userAccount = userAccount;
	}

	public String getTraceFileIdentifier() {
		return traceFileIdentifier;
	}

	/**
	 * @param traceFileIdentifier
	 */
	public void setTraceFileIdentifier(String traceFileIdentifier) {
		this.traceFileIdentifier = traceFileIdentifier;
	}

	/**
	 * @return
	 */
	public String getMaxDumpFileSize() {
		return maxDumpFileSize;
	}

	/**
	 * @param maxDumpFileSize
	 */
	public void setMaxDumpFileSize(String maxDumpFileSize) {
		this.maxDumpFileSize = maxDumpFileSize;
	}

	/**
	 * @return
	 */
	public int getSqlTraceLevel() {
		return sqlTraceLevel;
	}
	/**
	 * @param sqlTraceLevel
	 */
	public void setSqlTraceLevel(int sqlTraceLevel) {
		this.sqlTraceLevel = sqlTraceLevel;
	}
	/**
	 * @return
	 */
	public Integer getPropertyId() {
		return propertyId;
	}

	/**
	 * @param propertyId
	 */
	public void setPropertyId(Integer propertyId) {
		this.propertyId = propertyId;
	}

	/**
	 * @return
	 */
	public boolean isSqlTraceStatus() {
		return sqlTraceStatus;
	}
	/**
	 * @param sqlTraceStatus
	 */
	public void setSqlTraceStatus(boolean sqlTraceStatus) {
		this.sqlTraceStatus = sqlTraceStatus;
	}
	/* (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object o) {
		if (o == this){
			return true;
		} 
		
		if(o == null){
			return false;
		}
		if (getClass() != o.getClass()) {
			return false;
		}
		SqlTraceVO  obj = (SqlTraceVO) o;
		if(!StringUtil.isNullOrEmpty(obj.getUserAccount())){
			return true;
		}
		if(obj.getUserAccount().equals(this.getUserAccount())){
			return true;
		}
		return false;
	}
	
	@Override
	public int hashCode() {
		return super.hashCode();
	}
}
